#!/bin/python3
#-*- coding: utf-8 -*-
# exp_25.py
# @author 刘秋
# @email lq@aqiu.info
# @description 
# @created 2020-04-16T13:34:03.848Z+08:00
# @last-modified 2020-04-16T14:45:15.273Z+08:00
#

#求1+2!+3!+...+20!的和。

# def fact_iter(num, b):
#     if num == 1:
#         return b
#     return fact_iter(num - 1, b+(num*num-1))
# print(fact_iter(20,1))
print(2561327494111820313)

s = 1
t = []
for i in range(1,21):
    s *= i
    # print(s,"->",i)
    t.append(s)
print(sum(t),"*********")

s1=0
def fact_l (a):
    if a == 1 or a == 0:
        return 1
    return fact_l(a-1)*a


for i in range(1,21):
    s1 +=fact_l(i)
print(s1)